package com.bwie.product.service.impl;

import com.bwie.common.core.domain.Result;
import com.bwie.common.security.utils.SecurityUtils;
import com.bwie.product.domain.vo.MerchantSelectSkuListVo;
import com.bwie.product.mapper.ProductMerchantMapper;
import com.bwie.product.service.ProductMerchantService;
import com.bwie.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Service
public class ProductMerchantServiceImpl implements ProductMerchantService {
    /**
     * 注入
     */
    @Autowired
    private ProductMerchantMapper mapper;

    /**
     * 获得商户所拥有的sku
     * @return
     */
    @Override
    public List<MerchantSelectSkuListVo> getSelectSkuList() {
        //获取登录用户
        LoginUser loginUser = SecurityUtils.getLoginUser();
        //根据登录用户id获得sku集合
        List<MerchantSelectSkuListVo> list = mapper.getSelectSkuList(loginUser.getUserid());
        //返回
        return list;
    }
}
